package com.zmzncs.lmtc.module.shop.pojo.shop_order;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 商户-订单
 * </p>
 *
 * @author
 * @since 2021-05-20
 */
@Data
public class ShopOrderGoodsVO implements Serializable {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "shopOrderId")
    private Long shopOrderId;

    @ApiModelProperty(value = "订单编号")
    private String orderCode;

    @ApiModelProperty(value = "商品图片")
    private String fileUrl;

    @ApiModelProperty(value = "商户id")
    private Long shopId;

    @ApiModelProperty(value = "商户shopName")
    private String shopName;

    @ApiModelProperty(value = "商品id")
    private Long goodsId;

    @ApiModelProperty(value = "商品Name")
    private String goodsName;

    @ApiModelProperty(value = "商品图片")
    private List<String> goodsUrl;

    @ApiModelProperty(value = "应付金额")
    private BigDecimal payableAmount;

    @ApiModelProperty(value = "客户实付金额")
    private BigDecimal paidAmount;

    @ApiModelProperty(value = "支付给商户的金额")
    private BigDecimal paidShopAmount;

    @ApiModelProperty(value = "商品有效期")
    private Date expireDate;

    @ApiModelProperty(value = "核销码")
    private String writeOffCode;

    public List<String> getGoodsUrl() {
        return goodsUrl;
    }

    public void setGoodsUrl(List<String> goodsUrl) {
        if(goodsUrl!=null && goodsUrl.size()>0 ){
            String[] files =  goodsUrl.get(0).split(";");
            for(String fileStr : files){
                goodsUrl.add(fileStr);
            }
            goodsUrl.remove(0);
        }
        this.goodsUrl = goodsUrl;
    }
}
